package com.mycat.dfs.test;


import com.mycat.dfs.server.FastDFSUtil;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

/**
 * FastDFS文件服务器文件上传多线程测试
 *
 * @author roger.
 * @email 190642964@qq.com
 * @create 2017-02-06
 */
public class UploadThread implements Runnable {

    private FastDFSUtil util;

    public UploadThread(FastDFSUtil util){
        this.util = util;
    }

    @Override
    public void run() {
        try {
            File file = new File("E:\\QuikHouse_Pro\\doc\\4产品设计\\UI设计\\Version 1.0.0\\后台jpg\\01行政管理\\01大区设置.jpg");
            InputStream input = new FileInputStream(file);

            String name = util.uploadFile(input, "jpg");
            System.out.println(Thread.currentThread()+"   "+ Thread.currentThread().getName()+ "  http://192.168.0.209:80/" + name);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
